home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / clantutr.zip / TEST6-8 < prev   
Text File  |  1986-04-04  |  2KB  |  54 lines

  1. .T
  2.    and now a TEST   
  3. .R4C1
  4.     If we declare ~b~Ix~N to be an ARRAY of ~I6~N rows and ~I7~N columns, then:
  5. .Q
  6. The member of the ARRAY in row 3, column 3 is called 
  7. x[2][2]
  8.     ~Inot~N x(2,2) or x(2)(2) or x[3,3) or etc. etc.
  9.  
  10. .Q
  11. Which member does x+5*7+2 select ?
  12. x[5][2]
  13.  
  14. .Q
  15. Where does x point to ?
  16. x is NOT a pointer!
  17.  
  18.     ( The names of ~I1~N-dimensional arrays are ~w~Rpointers~N.)
  19.     ( Since, for example, ~b~Ix[2]~N is a 1-dim array, ~IIT~N is a ~w~Rpointer~N.)
  20. .Q
  21. x[3] points to which element ? 
  22. x[3][0]
  23. .WN
  24. 0 ~b~I#include <stdio.h>                      ~N
  25. 1 ~b~Imain() {                                ~N
  26. 2 ~b~I    char c;                             ~N
  27. 3 ~b~I    while ( (c=getchar()) !='e' ) {     ~N
  28. 4 ~b~I        if ( 'a'<=c && c<='z')          ~N
  29. 5 ~b~I            printf("%c",c+'A'-'a');     ~N
  30. 6 ~b~I    }                                   ~N
  31. 7 ~b~I}                                       ~N
  32. .Q
  33. If you type the letter  p  what will the program print ? 
  34. P
  35. .Q
  36. If you type the letter  P  what will the program print ? 
  37. P
  38. .Q
  39. What must you type to have the program stop ?
  40. e
  41. .WR9C1
  42.                                                                            
  43.                                                                            
  44.                                                                            
  45.                                                                            
  46.                                                                            
  47.                                                                            
  48.                                                                            
  49.                                                                            
  50.                                                                            
  51.                                                                            
  52. .w
  53. .R10C1
  54.     In Line 3, the program will ~b~Igetchar~N from the key